<template>
  <div class="city-nav-bar">
    <nav-bar class="nav-bar">
      <div class="center" slot="center">{{ cityDetail.name }}</div>
      <div class="right" slot="right" @click="handleSwitchCity">
        <span>切换城市</span>
      </div>
    </nav-bar>
  </div>
</template>

<script>
import { navbar } from "common/mixin";
export default {
  props: {
    cityDetail: {
      type: Object,
      default() {
        return {};
      },
    },
  },
  mixins: [navbar],
  methods: {
    handleSwitchCity() {
      this.$router.go(-1);
    },
  }
};
</script>
<style lang="less" scoped>
.city-nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;;
  color: #fff;
  z-index: 1;
  .nav-bar {
    padding-right: 10px;
    background-color: var(--color-tint);
  }
}
</style>